<%@page import="Entity.Course"%>
<%@page import="Dao.coursedao"%>
<%@page import="Dao.scheduledao"%>
<%@page import="Entity.Room_ced"%>
<%@page import="Entity.User"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 's_check_class.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
	<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
	<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha512-SfTiTlX6kk+qitfevl/7LibUOeJWlt9rbyDn92a1DqWOw9vWG2MFoays0sgObmWazO5BQPiFucnnEAjpAB+/Sw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
  	<link rel="shortcut icon" type="image/x-icon" href="logo.jpg" />
  	<script language="javascript"> 
		function openWin(url,name,newWinWidth,newWinHeight){
				var winWidth=screen.width;  //获取屏幕宽度
				var winHeight=screen.height;  //获取屏幕高度
				//获取新窗口距离屏幕左侧的位置
				var left=(winWidth-newWinWidth)/2;  
				//获取新窗口距离屏幕顶部的位置
				var top=(winHeight-newWinHeight)/2;
				window.open(url,name,'width='+newWinWidth+',height='+newWinHeight+',left='+left+',top='+top+',toolbar=no,menubar=no,location=no,status=no');
				//name:弹出窗口的名字,可不填，用''代替
				//toolbar=no 是否显示工具栏。yes为显示
				//menubar=no 是否显示菜单栏。yes为显示
				//location=no 是否显示地址字段。yes为显示
				//status=no 是否添加状态栏。yes为可以
			}

	</script> 
  
  
  </head>
  
  <body>
  <%
   User user =(User) session.getAttribute("user");
  	 if(user==null){
  	 	 request.getRequestDispatcher("login.jsp").forward(request,response);
  	 }
  	 String id = user.getUid();
  	
  	 List<Room_ced> courses_id =(List<Room_ced>) request.getAttribute("courses_id");
  	 
  	 System.out.print(courses_id);
  	  %>
    		<!-- 顶部-->
    	<div style="border: 1px;display: block;">
    			<image  src="image/title.png" style="width: 600px;">
    			<a href="personInfor.jsp" class="btn dropdown-toggle"  style="float: right;margin:auto 40px;">
    			<i class="fa fa-user-circle fa-2x"></i>
    			个人信息
		   		 </a>
    	</div>
    		<!-- 侧边栏 -->
    		<div style="float: left;width: 10%;height:90%; bottom:0;display: block;border-radius: 10px;
   		background-image: linear-gradient(to top, #accbee 0%, #e7f0fd 100%);">
    			<ul class="nav nav-pills nav-stacked">
				  <li class="active"><a href="SsearchServlet">上机安排</a></li>
				  <li ><a href="s_query.jsp">教室信息</a></li>
				  <li ><a href="Notice1Servlet">收件箱</a></li>
				</ul>
    		</div>
    		<!-- 正文 -->
	    	<div class="table-responsive" style="width:85%;" >
		    <table  class="table table-striped" style="max-height: 300px;width: 900px; margin:0 auto;" >
		    <thead>
			    <tr>
			     <th>课程编号</th>
			     <th>课程名称</th>
	             <th>时间</th>
	             <th>机房</th>
			    </tr>
		    </thead>
		    <tbody>
				<%if(courses_id!=null){
					for(Room_ced course_id:courses_id){
					String id1=course_id.getCourse_Id();
					System.out.print(id1);
					coursedao sced = new coursedao();
					Course course =sced.getCourse(id1);
				%>
				<tr>
				<td><%=course_id.getCourse_Id() %></td>
				<td><%=course.getCourse_Name() %></td>
				<td><%=course_id.getDate() %><%="第"%><%=course_id.getOrder() %><%="大节"%></td>
				<td><%=course_id.getRoom_Id() %></td>
				</tr>
				<%
				}
				}
				 %>   
			  </tbody>    
		    </table>
			</div>
  </body>
</html>
